# coding=utf-8


from fly2018.toolkit import db_kit
from apps.magic_models import MagicUser


def login_select(username, pwd):

    sql = "select count(1) from magic_user where username = '{}' and password = '{}'".format(username, pwd)
    rs = db_kit.fetch_one(sql)
    return rs[0]


def login_model(username, pwd):
    return MagicUser.objects.get(username=username, password=pwd)